package com.easylinkin.linkappapi.jzsmokewarning.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 荆州油烟预警
 * </p>
 *
 * @author TongJie
 * @since 2021-12-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("smoke_warning")
public class SmokeWarning extends Model<SmokeWarning> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键(自增)
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 租户id
     */
    @TableField("tenant_id")
    private String tenantId;
    /**
     * 设备编号
     */
    @TableField("device_code")
    private String deviceCode;

    /**
     * 设备名称
     */
    @TableField("device_name")
    private String deviceName;

    /**
     * 设备区域路径
     */
    @TableField("area_path")
    private String areaPath;

    /**
     * 周期,默认一小时统计一次
     */
    @TableField("cycle")
    private String cycle = "1";

    /**
     * 统计的数据量
     */
    @TableField("data_count")
    private Integer dataCount;

    /**
     * 平均值
     */
    @TableField("average_value")
    private Double averageValue;

    /**
     * 计算开始时间
     */
    @TableField("start_time")
    private Date startTime;
    /**
     * 计算结束时间
     */
    @TableField("end_time")
    private Date endTime;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;

    /**
     * 属性/单位
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "属性/单位", required = false)
    private String attribute = "油烟浓度mg/m³";


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
